Skip to content

containerd,nerdctl: preserve config files + add init script#29487

Open
dzavy wants to merge 2 commits into
openwrt:masterfrom
dzavy:containerd_nerdctl_sysconfig
Open

containerd,nerdctl: preserve config files + add init script#29487
dzavy wants to merge 2 commits into
openwrt:masterfrom
dzavy:containerd_nerdctl_sysconfig

Conversation

@dzavy

@dzavy dzavy commented May 19, 2026

Copy link
Copy Markdown
Contributor

📦 Package Details

Maintainer: @lu-zero

Description:
Preserve config files during sysupgrade + add init script for containerd


🧪 Run Testing Details

  • OpenWrt Version: 25.12.0
  • OpenWrt Target/Subtarget: mvebu/cortexa72
  • OpenWrt Device: Globalscale MOCHAbin

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

Comment thread utils/containerd/Makefile
Comment on lines +71 to +72
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/containerd.init $(1)/etc/init.d/containerd

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please separate adding init file to its own commit, pleaase? It would be better for cherry-picking.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both changes require bumping PKG_RELEASE so not sure how to achieve that cleanly?

@BKPepe BKPepe requested a review from Copilot May 19, 2026 12:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Preserves user configuration files during sysupgrade for both containerd and nerdctl packages, and adds a procd init script for containerd.

Changes:

  • Add conffiles definition to containerd and nerdctl Makefiles to preserve config files
  • Add a new procd init script for containerd
  • Bump PKG_RELEASE for both packages

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
utils/nerdctl/Makefile Bumps PKG_RELEASE and declares /etc/nerdctl/nerdctl.toml as conffile
utils/containerd/Makefile Bumps PKG_RELEASE, declares config.toml as conffile, installs new init script
utils/containerd/files/containerd.init New procd init script for containerd

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread utils/containerd/Makefile

define Package/containerd/install
$(INSTALL_DIR) $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/{ctr,containerd,containerd-stress,containerd-shim-runc-v2} $(1)/usr/bin/
start_service() {
procd_open_instance
procd_set_param respawn
procd_set_param command $CONTAINERD_BIN
Comment thread utils/nerdctl/Makefile
Comment on lines +38 to +41
define Package/nerdctl/conffiles
/etc/nerdctl/nerdctl.toml
endef

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is intentional. nerdctl.toml is not required, nerdctl would use defaults, however if it's overriden by user (especially to set data_root to persistent storage) it should be preserved during sysupgrade.

dzavy added 2 commits June 29, 2026 17:57
also add init script

Signed-off-by: Jan Havelka <dzavy@dzavy.net>
preserve config file during sysupgrade

Signed-off-by: Jan Havelka <dzavy@dzavy.net>
@BKPepe BKPepe force-pushed the containerd_nerdctl_sysconfig branch from ecc207e to a1ae588 Compare June 29, 2026 15:57

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 new commits; both commit messages match their changes. One inline suggestion on the new containerd init script; the config-default and commit-split points were already covered by earlier reviewers.


Generated by Claude Code

Comment on lines +11 to +15
start_service() {
procd_open_instance
procd_set_param respawn
procd_set_param command $CONTAINERD_BIN
procd_close_instance

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The service is started without raising the open-file limit. containerd, like the runtime it powers, keeps many file descriptors open (sockets, container fds, shim connections) and the kernel default (often 1024) is easily exhausted. The sibling dockerd.init in this repo sets procd_set_param limits nofile=... for exactly this reason; the standalone containerd instance should do the same.

Suggested change
start_service() {
procd_open_instance
procd_set_param respawn
procd_set_param command $CONTAINERD_BIN
procd_close_instance
start_service() {
local nofile=$(cat /proc/sys/fs/nr_open)
procd_open_instance
procd_set_param respawn
procd_set_param command $CONTAINERD_BIN
procd_set_param limits nofile="${nofile} ${nofile}"
procd_close_instance

Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants